import request from '@/utils/request'
//获取收到的消息--自定义
export function postMessageReceivePage(data) {
  return request({
    url: '/messageReceive/customizeList/page',
    method: 'post',
    data,
  })
}

export function messageReceivePage(params) {
  return request({
    url: '/messageReceive/page',
    method: 'get',
    params,
  })
}

export function messageReceiveGetById(id) {
  return request({
    url: '/messageReceive/' + id,
    method: 'get',
  })
}

//更新消息是否已读状态-单条
export function updateReadStatusById(id) {
  return request({
    url: '/messageProduction/updateReadStatusById/' + id,
    method: 'put',
  })
}

//更新消息是否已读状态-批量
export function updateReadStatusBatch(data) {
  return request({
    url: '/messageProduction/updateReadStatusBatch',
    method: 'put',
    data,
  })
}
//更新消息是否已读状态-全部
export function updateReadStatusAll() {
  return request({
    url: '/messageProduction/updateReadStatusAll',
    method: 'put',
  })
}

//分页获取消息通知模板
export function getMessageTemplatePage(params) {
  return request({
    url: '/messageTemplate/page',
    method: 'get',
    params,
  })
}

//新增消息模板
export function addMessageTemplatePage(data) {
  return request({
    url: '/messageTemplate',
    method: 'post',
    data,
  })
}

//更新消息模板
export function updateMessageTemplatePage(data) {
  return request({
    url: '/messageTemplate',
    method: 'put',
    data,
  })
}

// 消息模板删除
export function delMessageTemplatePage(id) {
  return request({
    url: '/messageTemplate/' + id,
    method: 'delete',
  })
}

//启用消息
export function enableMessageTemplate(data) {
  return request({
    url: '/messageTemplate/enabled',
    method: 'post',
    data,
  })
}

//停用消息
export function disableMessageTemplate(data) {
  return request({
    url: '/messageTemplate/disabled',
    method: 'post',
    data,
  })
}
export function getMessageReceiveCountByStatus(data) {
  return request({
    url: '/messageReceive/selectOrderCountGroupByStatus',
    method: 'post',
    data,
  })
}
